CC = gcc
CFLAGS = -Wall -Wextra -g
LDFLAGS = -lavformat -lavcodec -lavutil

TARGET = read_mp4_info
SRCS = read_mp4_info.c
OBJS = $(SRCS:.c=.o)

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(TARGET)

run: $(TARGET)
	./$(TARGET) ../sample.mp4

.PHONY: all clean run